//5!

/* function js(n){
    let result = 1;
    for(let i = 1; i <= n; i++){
        result *= i;
    }
    return result;
}
console.log(js(5)); */
function jc(n){
    if(n==1){
        return 1;
    }
     return n*jc(n-1);
}
console.log(jc(10));

//jc(5) => 5*js(4)
//js(4) => 4*jc(3)
//js(3) => 3*jc(2)
//jc(2) => 2*jc(1)
//jc(1) === 1